package com.tang.portal.controller.callback;

import com.github.binarywang.wxpay.exception.WxPayException;
import com.tang.framework.core.controller.BaseController;
import com.tang.framework.core.domain.HttpResult;
import com.tang.portal.facade.callback.WxCallBackFacade;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

/**
 * @Author tang jun liang
 * @Date 2023/6/27 21:53
 */
@Tag(name = "微信回调接口")
@RestController
@RequestMapping(name = "/wx/callback")
public class WxCallBackController extends BaseController {

    @Resource
    private WxCallBackFacade wxCallBackFacade;


    @PostMapping("/pay")
    public HttpResult<String> pay(@RequestBody String xml) throws WxPayException {
        return wxCallBackFacade.pay(xml);
    }
}
